#include <bits/stdc++.h>
using namespace std;
int convert(char ch){
    switch (ch){
        case 'A':
        case 'B':
        case 'C':
            return 2;
        case 'D':
        case 'E':
        case 'F':
            return 3;
        case 'G':
        case 'H':
        case 'I':
            return 4;
        case 'J':
        case 'K':
        case 'L':
            return 5;
        case 'M':
        case 'N':
        case 'O':
            return 6;
        case 'P':
        case 'R':
        case 'S':
            return 7;
        case 'T':
        case 'U':
        case 'V':
            return 8;
        case 'W':
        case 'X':
        case 'Y':
            return 9;
        default:
            return -1;
    }
}
int main(){
    ios :: sync_with_stdio(false);
    int code=4734;
    bool flag=false;
    // cin>>code;
    int pwd = code;
    int len = 0;
    while (code){
        code /= 10;
        len ++;
    }
    int num = 0;
    char ch;
    do{
        string s;
        for (int i=0;i<len;i++){
            ch = getchar();
            s += ch;
            num += convert(ch);
            num *= 10;
        }
        if (num == code*10){
            flag = true;
            cout<<s<<'\n';
        }
        getchar();
    }
    while (ch);
    if (!flag) cout<<"NONE";
    return 0;
}
